/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.spring.modelo.entidad;

import java.io.Serializable;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author karolyn
 */
@Entity
@Table(name = "Aula")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Aula.findAll", query = "SELECT a FROM Aula a"),
    @NamedQuery(name = "Aula.findByCodAula", query = "SELECT a FROM Aula a WHERE a.codAula = :codAula"),
    @NamedQuery(name = "Aula.findByDescAula", query = "SELECT a FROM Aula a WHERE a.descAula = :descAula"),
    @NamedQuery(name = "Aula.findByActivo", query = "SELECT a FROM Aula a WHERE a.activo = :activo")})
public class Aula implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    @Column(name = "codAula")
    private Integer codAula;
    @Size(max = 50)
    @Column(name = "descAula")
    private String descAula;
    @Column(name = "activo")
    private Boolean activo;
    @OneToMany(mappedBy = "codAula")
    private List<Programacion> programacionList;

    public Aula() {
    }

    public Aula(Integer codAula) {
        this.codAula = codAula;
    }

    public Integer getCodAula() {
        return codAula;
    }

    public void setCodAula(Integer codAula) {
        this.codAula = codAula;
    }

    public String getDescAula() {
        return descAula;
    }

    public void setDescAula(String descAula) {
        this.descAula = descAula;
    }

    public Boolean getActivo() {
        return activo;
    }

    public void setActivo(Boolean activo) {
        this.activo = activo;
    }

    @XmlTransient
    public List<Programacion> getProgramacionList() {
        return programacionList;
    }

    public void setProgramacionList(List<Programacion> programacionList) {
        this.programacionList = programacionList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codAula != null ? codAula.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Aula)) {
            return false;
        }
        Aula other = (Aula) object;
        if ((this.codAula == null && other.codAula != null) || (this.codAula != null && !this.codAula.equals(other.codAula))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.spring.modelo.entidad.Aula[ codAula=" + codAula + " ]";
    }
    
}
